package com.wzcl.app.dao.model;


import com.wzcl.app.dao.model.common.Base;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;

@Data
@Entity
@ApiModel(value = "文件表")
@Table(name = "AppFile",
        uniqueConstraints = {
                @UniqueConstraint(columnNames = {"fileKey"})
        }
)
@EntityListeners(AuditingEntityListener.class)
public class AppFile implements Base {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @ApiModelProperty(value = "hash值")
    private String hash;

    @ApiModelProperty(value = "文件名")
    private String name;

    @ApiModelProperty(value = "fileKey")
    private String fileKey;

    @ApiModelProperty(value = "文件大小")
    private Long size;

    @ApiModelProperty(value = "文件地址")
    private String src;

    @ApiModelProperty(value = "文件类型")
    private String type;

    @CreatedDate
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

}
